<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta name="format-detection" content="telephone=no" />
    <link rel="stylesheet" href="../../static/mobile/default/css/layout.css?v=2" />
    <link rel="icon" type="image/png" href="../../static/favicon.ico" />
    <script src="../../static/js/jquery/jquery/2.1.4/jquery.min.js"></script>
    <script src="../../static/js/jquery/jquery.cookie.js"></script>
    <script src="../../static/mobile/default/js/page.js?v=1"></script>
    <title>忘记密码 - 达漂亮</title>

    <link rel="stylesheet" href="../../static/mobile/default/css/userData.css" />


</head>

<body>
    <div class="page ">
        <div class="page-hd">
            <div class="header base-header bor-1px-b">
                <div class="header-left">
                    <a href="javascript:history.go(-1)" class="left-arrow"></a>
                </div>
                <div class="header-title">忘记密码</div>
                <div class="header-right">
                    <!-- <a href=""></a> -->
                </div>
            </div>
        </div>

        <div class="page-bd userData">
            <!-- 页面内容-->
            <div class="cells ">

                <div class="cell">
                    <div class="cell_hd">
                        <span class="fs28 color_3 fw_b">手机号</span>
                    </div>
                    <div class="cell_bd">
                        <input type="text" class="fs28 fw_b  color_3" placeholder="请输入注册手机号" id="mobile">
                    </div>
                </div>
                <div class="cell">
                    <div class="cell_hd">
                        <span class="fs28 color_3 fw_b">验证码</span>
                    </div>
                    <div class="cell_bd">
                        <input type="text" class="fs28 fw_b  color_3 codeBox" style="width: 2rem" placeholder="请输入验证码">
                    </div>
                    <div class="cell_ft">
                        <span class="color_r fs28 fw_b getCode" onclick="codeButton()">获取验证码</span>
                        <span class="color_9 fs28 fw_b time" style="display:none">60s</span>
                    </div>
                </div>
                <div class="cell">
                    <div class="cell_hd">
                        <span class="fs28 color_3 fw_b">新密码</span>
                    </div>
                    <div class="cell_bd">
                        <input type="password" class="fs28 fw_b  color_3" placeholder="请输入新密码" id="password">
                    </div>
                </div>
                <div class="cell">
                    <div class="cell_hd">
                        <span class="fs28 color_3 fw_b">确认密码</span>
                    </div>
                    <div class="cell_bd">

                        <input type="password" class="fs28 fw_b  color_3" placeholder="请再次输入新密码" id="cfm_password">
                    </div>
                </div>
            </div>
            <div class="page-ft">
                <span class="fs32 color_w fw_b BGcolor_r forgetpwd">确定</span>
            </div>
        </div>


    </div>

    <script src="../../static/js/art-template.js"></script>
    <script src="../../static/mobile/default/js/lib/fastclick.js"></script>
    <script src="../../static/js/jquery/lazyload/jquery.lazyload.js"></script>
    <script>
        $(function() {
            FastClick.attach(document.body);
            $("img.lazy").lazyload({
                effect: "fadeIn",
                event: "scroll",
                container: $(".page-bd")
            });
        });
    </script>

    <script>
        $('.forgetpwd').on('click', function() {
            var arr = new Object();
            arr.mobile = $('#mobile').val();
            arr.password = $('#password').val();
            arr.cfm_password = $('#cfm_password').val();
            if (arr.mobile == '') {
                _alert('请输入手机号码.');
                return false;
            }

            if ($('.codeBox').length > 0) {
                arr.code = $('.codeBox').val();
                if (arr.code == '') {
                    _alert('请输入验证码..');
                    return false;
                }
            }

            if (arr.password == '') {
                _alert('请输入新密码.');
                return false;
            }
            if (arr.password.length < 8) {
                _alert('新密码长度不能小于八位.');
                return false;
            }
            if (arr.password !== arr.cfm_password) {
                _alert('两次输入的密码不一致.');
                return false;
            }

            jq_ajax('/member/api.passport/forgetpwd.html', arr, function(res) {
                if (res.code == 0) {
                    _alert(res.errmsg);
                    return false;
                }
                _alert(res.errmsg, '/member/passport/login.html');
            })
        })

        function codeButton() {
            var arr = new Object();
            arr.type = 'forget_password';
            arr.mobile = $('#mobile').val();
            if (arr.mobile == '') {
                _alert('请输入手机号码');
                return false;
            }
            jq_ajax('/publics/api.sms/sendcode.html', arr, function(res) {
                if (res.code == 0) {
                    _alert(res.errmsg);
                    return false;
                }
                var timeObj = $('.time')
                var getCodeObj = $('.getCode')
                getCodeObj.hide();
                timeObj.show();
                var time = 60;
                var set = setInterval(function() {
                    timeObj.text("" + --time + "s");
                    if (time <= 0) {
                        timeObj.hide();
                        getCodeObj.show();
                        clearInterval(set);
                    }
                }, 1000);
            })

        }
    </script>


    <div class="alertBox">
        <div class="alertBG"></div>
        <div class="alert">
            <div class="text fs30 color_3 bor_b">

            </div>
            <!-- 单按钮 -->
            <div class="button fs32 fw_b color_r">
                知道了
            </div>
            <!-- 双按钮 -->
            <div class="buttonBox fs32 fw_b">
                <span class="color_9 bor_r cancel">取消</span>
                <span class="color_r confirm">确定</span>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var is_xcx = 0;
        $(document).on('click', 'a', function() {
            var href = $(this).attr('href');
            if (href.indexOf('/pages') != -1) {
                if (is_xcx == 1) {
                    wx.miniProgram.navigateTo({
                        url: href
                    })
                    return false;
                } else {
                    return false;
                }
            }
        })
    </script>
</body>

</html>